/**
 * 
 */
package org.mhz.sit.dataaccess;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.mhz.sit.entity.Speaker;
import org.mhz.sit.entity.SpeakerOffTopicOrder;
import org.mhz.sit.entity.SpeakerOrder;
import org.mhz.sit.util.DatabaseUtil;
import org.mhz.sit.util.HibernateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Mahan
 *
 * Configure Speakers data access
 */
@Transactional
public class ConfigureSpeakersDAO
{
    private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseUtil.class);
    
    /**
     * Retrieves all speakers
     * 
     * @return a list of speakers
     */
    @SuppressWarnings("unchecked")
    public List<Speaker> getAll() 
    {
        return (List<Speaker>) DatabaseUtil.getData(Speaker.class.getName());
    }
    
    /**
     * Retrieves the order of speakers
     * 
     * @return The order of speakers
     */
    @SuppressWarnings("unchecked")
    public List<SpeakerOrder> getOrderOfSpeakers() 
    {
        return (List<SpeakerOrder>) DatabaseUtil.getData(SpeakerOrder.class.getName());
    }
    
    /**
     * Retrieves the order of off topic speakers
     * 
     * @return The order of off topic speakers
     */
    @SuppressWarnings("unchecked")
    public List<SpeakerOffTopicOrder> getOffTopicOrder() 
    {
        return (List<SpeakerOffTopicOrder>) DatabaseUtil.getData(SpeakerOffTopicOrder.class.getName());
    }     
}
